<template>
	 <mdp-lr-box ref="dept" :lspan="6">
		<template #left>
			<dept-tree @check-change="onDeptChange"/>
		</template>
		<mdp-lr-box ref="post" :lspan="12">
			<template #left >
				<dept-post-index v-if="filters.deptid" ref="deptPost" :params="{deptid:filters.deptid}" @row-click="filters.postId=$event.postId"/>
			</template>
			<post-role v-if="filters.postId" :params="{postId:filters.postId}" ref="postRole"/>
		</mdp-lr-box>
	 </mdp-lr-box>
</template>

<script>
	import util from '@/components/mdp-ui/js/util';//全局公共库 
 	import { mapState } from 'pinia'
import { useUserStore } from '@/store/modules/user'
import DeptPostIndex from './Index.vue'
import PostRole from '../postRole/Index.vue'
	export default {  
		components: {
			DeptPostIndex,PostRole
		},
		data() {
			return {
				 filters:{
					deptid:'',
					postId:'',
				 }
			}
		}, 
		methods: {
			onDeptChange(dept,checked){
				if(checked){
					this.filters.deptid=dept.deptid
					this.filters.postId=null
				}else{
					this.filters.deptid=null 
					this.filters.postId=null
				}
			}

		}, 

		mounted() {   
		}
	}

</script> 
